﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace YasharEl.Infrastructure.SoftwareModel.SOA
{
    /// <summary>
    /// Process Services tie together the data-centric and action-centric building blocks 
    /// to implement the business processes of the organization. 
    /// They compose the functionality offered by Activity Services, 
    /// Capability Services, and Entity Services and tie them together 
    /// with business logic that lives inside the Process Service 
    /// to create the blueprint that defines the operation of the business. 
    /// An example of a Process Service is a purchase order processing service 
    /// that receives a purchase order, verifies it, 
    /// checks the customer blacklist service to make sure that the customer is okay to work with, 
    /// checks the customer's credit with the credit verification service, 
    /// adds the order to the order-list managed by the orders (entity) service, 
    /// reserves the goods with the inventory (entity) service, 
    /// secures the payment via the payment processing service, 
    /// confirms the reservation made with the inventory (entity) service, 
    /// schedules the shipment with the shipping service, 
    /// notifies the customer of the successful completion of the order 
    /// and the ETA of the goods via the e-mail gateway service, 
    /// and finally marks the order as completed in the order list.
    /// 
    /// Process Services may be composed into the workflows of other Process Services, 
    /// but they will not be recategorized as capability or Activity Services, 
    /// because of their scope and long-running nature.
    /// Because Process Services implement the business processes of the organization, 
    /// they are often fronted with a user interface that initiates, controls, and monitors the process. 
    /// The service interface that these services expose is typically geared towards consumption by an end-user application, 
    /// and provides the right level of granularity required 
    /// to satisfy the use cases that the user facing front-end implements. 
    /// Monitoring the business process will at times require a separate monitoring interface 
    /// that exposes BAM information. 
    /// For example, the order processing service may report the number of pending, 
    /// in-process, and completed orders, and some statistical information about them 
    /// (median time spent processing and order, average order size, and so on).
    /// 
    /// Process Services typically manage the application state related to a particular process 
    /// for the duration of that process. 
    /// For example, the purchase order processing service will manage 
    /// the state of the order until it completes. 
    /// In addition, a Process Service will maintain 
    /// and track the current step in the business process. 
    /// For example, a Process Service implemented as a workflow will hold the execution state 
    /// for all the currently running workflow instances.
    /// 
    /// Users of Process Services may require that a permission be configured for them in order to use the service. 
    /// Access to a Process Service is typically granted at the user level.
    /// 
    /// Process Services very rarely support participation in a distributed atomic transaction, 
    /// because they provide support for long-running business activities (long-running transactions) 
    /// where error compensation happens at the business-logic level and compensation may involve human workflows. 
    /// Process Services may utilize distributed atomic transactions when calling 
    /// into the services they use. 
    /// They may also implement the reservation pattern.
    /// 
    /// Process Services are typically developed and managed in-house, 
    /// because they capture the value-add essence of the organization, the "secret sauce" that defines the way 
    /// in which the organization does its business. 
    /// Process Services are designed to enable process agility 
    /// (that is, to be easily updatable), and the processes that they implement are typically episodic in nature 
    /// (the execution consists of short bursts of activity spaced by long waits for external activities to complete). 
    /// Therefore, Process Services are best implemented as declarative workflows 
    /// using a workflow server (such as Microsoft's BizTalk Server) or a workflow framework (such as Microsoft's Windows Workflow Foundation).
    /// 
    /// Process Services are typically used by a single application and, 
    /// therefore, are managed individually (for example, at a departmental level). 
    /// In some cases, a reusable business process may become a commodity that can be offered or consumed as SaaS.
    /// </summary>
    public interface IProcessService : IApplicationService
    {
    }
}
